package com.itheima.thread.atomic.demo05;

import java.util.concurrent.atomic.AtomicInteger;

public class VolatileAtomicThread implements Runnable {

    private AtomicInteger atomicInteger = new AtomicInteger();

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            int incrementAndGet = atomicInteger.incrementAndGet();
            System.out.println(Thread.currentThread().getName() + ",," + incrementAndGet);
        }
    }
}
